
<?php
Class Tools extends CI_Model
{
 function get_records($page = 1, $limit = 10)
 {
     $offset = ($page - 1) * $limit;
     $this->db->where('state', 0);
     $this->db->limit($limit, $offset);
     $query = $this->db->get('tools');
     if($query->num_rows > 0){
         return $query->result_array();
     } else {
         return null;
     }

 }
}
?>